package com.nektos.ccf.client;

import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.CheckBox;

public class DescriptiveCheckBox extends CheckBox {
	public DescriptiveCheckBox(String label, String description) {
        super(label);
        
        MouseOverPopup mop = new MouseOverPopup(description);
        this.addMouseOverHandler(mop);
        this.addMouseOutHandler(mop);
        
	}
	 public void sinkEvents(int eventBitsToAdd) {
         Element inpElem = (Element) getElement().getChild(0);
         Element lblElem = (Element) getElement().getChild(1);
	    if (isOrWasAttached()) {
	      Event.sinkEvents(inpElem, eventBitsToAdd | Event.getEventsSunk(inpElem));
	      Event.sinkEvents(lblElem, eventBitsToAdd | Event.getEventsSunk(lblElem));
	    } else {
	      super.sinkEvents(eventBitsToAdd);
	    }
	  }
    
	
	
}
